<% content_for :title, t(:groups) -%>

<h1><%= content_for :title %></h1>
<p>
  <span class="group_menu"><%= image_tag('group_add.png', :alt => t(:create_a_new_group)) %> <%= link_to t(:create_a_new_group), new_group_path %></span>
</p>
<table>
  <tr>
    <th></th>
    <th><%= t :name %></th>
    <th></th>
  </tr>
<% @groups.each do |group| -%>
  <tr class="<%= cycle('even','odd') %>">
  <% if group.admins_group? -%>
    <td><%= image_tag('group_grey.png') %></td>
    <td class="group_name disabled"><%= group.name %></td>
    <td></td>
  <% else -%>
    <td><%= image_tag('group.png') %></td>
    <td class="group_name"><%= group.name %></td>
    <td>
      <%= link_to image_tag('edit.png', :alt => t(:edit)), edit_group_path(group), :title => t(:edit) %>&nbsp;
      <%= link_to image_tag('delete.png', :alt => t(:delete_item)), group_path(group), :method => :delete, :data => { :confirm => t(:are_you_sure) }, :title => t(:delete_item) %>
    </td>
  <% end -%>
  </tr>
<% end -%>
</table>
